<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html>
	<head>
		<title></title>
       <%@ include file="/common/meta.jsp"%>
       <SCRIPT LANGUAGE="Javascript" SRC="FlashChart/swfobject.js"></SCRIPT>
       	<link rel="stylesheet" type="text/css" href="<s:url value="/grid/gt_grid.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/default/skinstyle.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/china/skinstyle.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/vista/skinstyle.css"/>" />
		<link rel="stylesheet" type="text/css" href="<s:url value="/grid/skin/mac/skinstyle.css"/>" />
		<script type="text/javascript" src="<s:url value="/grid/gt_msg_cn.js"/>"></script>
		<script type="text/javascript" src="<s:url value="/grid/gt_grid_all.js"/>"></script>
 		<script language="JavaScript" src="<s:url value="/FusionCharts/FusionCharts.js"/>"></script>
 		<style>
 		.ddbox{background-color:#e5ecf9;border-bottom:1px solid #bacddc;padding:2px 5px 2px 5px;font-size:110%;height:25px}
 		.t10 { 
		    BORDER-RIGHT: #ffff00 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #ffff00 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #ffff00 1px solid; COLOR: #ffff00; PADDING-TOP: 5px; BORDER-BOTTOM: #ffff00 1px solid; HEIGHT: 20px; BACKGROUND-COLOR:#2f4f4f 
		} 
		.t10:hover { 
		    BORDER-RIGHT: #0000ff 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #0000ff 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #0000ff 1px solid; COLOR: #333333; PADDING-TOP: 5px; BORDER-BOTTOM: #0000ff 1px solid; HEIGHT: 20px; BACKGROUND-COLOR: #c8d8f0 
		}
 		</style>
	</head>
	<body style="margin: 0px; margin: 2px;">
		
		<div  id="grid_container">
			<div class="ddbox" id="grid_m_container" style="width:100%;height:70px;margin:5px;border: 1px solid #C1DAD7;">
				<b><font color="#2f4f4f">说明：</font></b>
				<s:if test="jbxx.mc!=''">
					<b><font color="#2f4f4f"><s:property value="jbxx.mc"/>(<s:property value="jbxx.sm"/>)</font></b>
					&nbsp;&nbsp;
					<b><a target=_blank href="jfhsb!doExportExcel.do"><font color="red">导出金凤凰经费资助（奖励）登记表</font></a></b>
					
					<br><br>
					<select name="where" style="width:100px">
						<option value="XM">姓名</option>
					</select>
					<input type="text" name="name" value=""/>
					<input type="button" class="button3" value="查   询" onclick="queryDq()">
					
					<input type="button" class="button3" value="生活资助、住房补助申报" onclick="datatb()">
					
					<input type="button" class="button3" value="删除申报数据" onclick="deltb()">
					
					<input type="button" class="button3" value="数据提交" onclick="dosb()">
					
				</s:if>
				<s:else>
					<b><font color="red">未启用上报! 不能申报</font></b>
					<br><br>
					<select name="where" style="width:150px">
						<option value="XM">姓名</option>
					</select>
					<input type="text" name="name" value=""/>
					<input type="button" class="button3" value="查&nbsp&nbsp询" onclick="queryDq()">
				</s:else>
				
				
				
			</div>
			<div id="grid_d_container"  style="width:100%;height:250px;margin:5px;border: 1px solid #C1DAD7;"></div>
			
		</div>
	</body>

	<script type="text/javascript">
	$('grid_container').style.height = (getSize().h - 20)+"px"; 
	
	var APP_PATH = '<c:url value="/"/>';
	var grid_demo_id = "myGrid1";
	var dsOption = {
		fields :  [ {name : 'SBID'},
					{name : 'XM'}, 
					{name : 'BZ'}, 
		   		    {name : 'SEX'}, 
		   		    {name : 'B_NL'},
		   		    {name : 'DWMC'},  
		   		    {name : 'XL_MC'}, 
		   		    {name : 'ZC_MC'}, 
		   		    {name : 'ZYTC'}, 
					{name : 'ZJZ'}, 
					{name : 'SHZZBZ'}, 
					{name : 'SHZCSJ'}, 
					{name : 'SHZZZE'}, 
					{name : 'ZFZFD'}, 
					{name : 'ZFBTBZ'}, 
					{name : 'ZFZCSJ'}, 
					{name : 'ZFBTZE'}, 
					{name : 'SM'}
					/*,
					{name : 'url' }
					*/
					]
	};

	var colsOption = [ 
	 {
		id : 'RYID',
		header : "序号",
		headAlign:"center",
		width : 50,
		align : "center",
		isCheckColumn : true,
		filterable : false
     },{
		id : 'BZ',
		header : "状态",
		headAlign:"center",
		width : 70,
		headAlign:"center",
		renderer:function (v,r){
			var ss = "";
			if(r.DC != null && r.DC != ''){
				ss ="<font color=blue>待提交</font>";if(v==5){ss="<font color=blue>已提交</font>";}else if(v==3){ss="<font color=blue>审核通过</font>";}else if(v==4){ss="<font color=blue>审核退回</font>"}
			}else{
				ss = "未报";
			}
			return ss;
		}
	}, {
		id : 'XM',
		header : "姓名",
		width : 100,
		headAlign:"center",
		align : "left"
		
	}, {
		id : 'SFZ',
		header : "身份证",
		width : 150,
		headAlign:"center",
		align : "left"
		
	}, {
		id : 'SEX_MC',
		header : "性别",
		headAlign:"center",
		width : 60,
		align : "center"
	}, {
		id : 'SHZZBZ',
		header : "资助标准(生活)",
		width : 100,
		headAlign:"center",
		align : "center"
	}, {
		id : 'SHZCSJ',
		header : "在常时间(生活)",
		width : 100,
		headAlign:"center",
		align : "center"
	}, {
		id : 'SHZZZE',
		header : "资助金额(生活)",
		width : 100,
		headAlign:"center",
		align : "center"
	}/*, {
		id : 'ZFZFD',
		header : "住宿地(住房)",
		width : 100,
		headAlign:"center",
		align : "center"
	}
	*/
	, {
		id : 'ZFBTBZ',
		header : "补贴标准(住房,城内)",
		width : 120,
		headAlign:"center",
		align : "center"
	}, {
		id : 'ZFZCSJ',
		header : "在常时间(住房,城内)",
		width : 120,
		headAlign:"center",
		align : "center"
	}, {
		id : 'ZFBTZE',
		header : "资助金额(住房,城内)",
		width : 120,
		headAlign:"center",
		align : "center"
	},{
		id : 'ZFBTBZ2',
		header : "补贴标准(住房,城外)",
		width : 120,
		headAlign:"center",
		align : "center"
	},{
		id : 'ZFZCSJ2',
		header : "在常时间(住房,城外)",
		width : 120,
		headAlign:"center",
		align : "center"
	}, {
		id : 'ZFBTZE2',
		header : "资助金额(住房,城外)",
		width : 120,
		headAlign:"center",
		align : "center"
	}
];

	var gridOption = {
		id : grid_demo_id,
		skin : "vista",
		width : "100%",
		height : getSize().h-100,
		pageSize : 25,
		container : 'grid_d_container',
		showGridMenu : true,
		allowCustomSkin : true,
		selectRowByCheck : true, 
		allowFreeze : true,
		allowHide : true,
		allowGroup : true,
		stripeRows : true,
		toolbarContent : 'nav | goto | pagesize | reload | export xls | print | filter | state | info',
		pageSizeList : [ 25, 50, 100, 200, 500 ],
		lightOverRow : true,
		showIndexColumn : false,
		dataset : dsOption,
		columns : colsOption,
		remoteSort : true,
		remoteFilter : true,
		loadURL : APP_PATH + '/jfhsb!getShzfList.do',
		exportURL : APP_PATH + '/jfhsb!exportShzfList.do',
		exportFileName : "列表",
		autoLoad : true,
		showIndexColumn : true,
		parameters:{}
	};
	
	var mygrid = new Sigma.Grid(gridOption);
	Event.observe(window, "load", function() {
		mygrid.render();
	}, true);
	
	
	function dosb(){
		var len = mygrid.getSelectedRecords().length;
		if(len < 1){
			alert("请选择需要提交的数据！");
			return false;
		}
		var r = new Array();
		for(var i=0;i<len;i++){
			r.push(mygrid.getSelectedRecords()[i].RYID);
		}
		
		if(window.confirm("请确定要提交当前申报数据!")){
			var ajax = new AppAjax("jfhsb!doJfhShzfBySb.do?ryid="+r,save_Back_mx).submit();
		}
	}
	
	function save_Back_mx(data){
		if(data.message.code >0){
			alert("提交成功！");
			queryDq();
		}else{
			alert(data.message.text);
		}
	}
	
	function queryDq(){
		mygrid.query({"name":$F("name"),"where":$F("where")});
	}
	
	
	function datatb(){
		var len = mygrid.getSelectedRecords().length;
		if(len < 1){
			alert("请选择需要填报的数据！");
			return false;
		}
		if(len > 1){
			alert("只能选择一条数据!");
			return false;
		}
		new AppAjax("jfhsb!checkRcfjInfo.do?ttype=1&ryid="+mygrid.getSelectedRecords()[0].RYID,
		function (data){
			if(data != null && data.message.code > 0){
				openWin("jfhsb!preJfhzf.do?ryid="+mygrid.getSelectedRecords()[0].RYID,"830","550");
			}else{
				alert(data.message.text);
			}
		}).submit();
	}
	
	function deltb(){
		var len = mygrid.getSelectedRecords().length;
		if(len < 1){
			alert("请选择需要删除的数据！");
			return false;
		}
		
		if(window.confirm('您确定要删除当前填报数据？')){
			var r = new Array();
			for(var i=0;i<len;i++){
				r.push(mygrid.getSelectedRecords()[i].RYID);
			}
			
			new AppAjax("jfhsb!doJfhshzfD.do?ryid="+r,
			function (data){
				if(data != null && data.message.code > 0){
					alert('删除成功！');
					queryDq();
				}else{
					alert(data.message.text);
				}
			}).submit();
		}
	}
	</script>

</html>